<script type="text/javascript">
function doClick(o){
	 o.className="nav_current";
	 var j;
	 var id;
	 var e;
	 for(var i=1;i<=4;i++){
	   id ="nav"+i;	   
	   j = document.getElementById(id);
	   e = document.getElementById("sub"+i);
	   if(id != o.id){
	   	 j.className="nav_link";
	   	 e.style.display = "none";
	   }else{
			e.style.display = "block";
	   }
	 }
	 
}
</script>
<script language="javascript" src="/public/js/LodopFuncs.js"></script>
<object id="LODOP_OB" classid="clsid:2105C259-1E0C-4534-8141-A753534CB4CA" width=0 height=0> 
	<embed id="LODOP_EM" type="application/x-print-lodop" width=0 height=0 pluginspage="install_lodop32.exe"></embed>
</object> 
<style>
*{ margin:0; padding:0; font-size:12px; text-decoration:none}
body{ text-align:center;}
#divcss5{ margin:0 auto; width:500px; overflow:hidden;}
ul,li{ list-style:none}
.dis{ display:block}
.undis{ display:none}
.nav{ width:100%; margin:0 auto; height:26px; padding-top:4px;}
.nav li{ float:left; width:98px; height:26px; padding-right:5px}
.nav li a{float:left; width:98px; height:26px; text-align:center; line-height:26px}
.nav li.nav_current a{color:#00F; background:url(/public/images/a_1.gif) no-repeat 0 0; }
.nav li.nav_link a{ color:#333;background:url(/public/images/a_2.gif) no-repeat 0 0;}
.nav-down{ min-height:300px; border:1px solid #000; border-radius:3px; text-align:left}
.table_form td{padding-left:12px;}
.table_form th{font-weight:normal; text-align:right;padding-right:10px; color:#666; width:100px;}
.table_form td label{ vertical-align:middle}
.table_form td , .table_form th{padding:8px 0 5px 8px;line-height:22px;}
.table_form tbody td,.table_form tbody th{border-bottom:1px solid #eee; }
.input-text {border:1px solid #A7A6AA; min-width:200px; line-height:18px;height:18px;margin:0 5px 0 0;padding:2px 0 2px 5px;border: 1px solid #d0d0d0;background: #FFF; font-size:12px;}
.input-focus{background: #FFF; border-color:#afcee6;font-size:12px;}
</style>
</head>
<body>
<div id="divcss5">
	<ul class="nav">
    	<li class="nav_current" id="nav1" onclick="javascript:doClick(this)"><a href="javascript:;">条形码打印</a></li>
        <!--<li class="nav_link" id="nav2" onclick="javascript:doClick(this)"><a href="javascript:;">物料测试</a></li>-->
        <li class="nav_link" id="nav3" onclick="javascript:doClick(this)"><a href="javascript:;">条形码打印2</a></li>
        <!--<li class="nav_link" id="nav4" onclick="javascript:doClick(this)"><a href="javascript:;">条形码打3</a></li>-->
    </ul>
    <div class="nav-down">
    <div class="dis" id="sub1">	
	<table cellpadding="0" cellspacing="0" class="table_form" width="100%">
		<tbody>
		<tr>
        	<th>编码：</th>
            <td>
			<select id="code1">
				<option value="128A">128A</option>
				<option value="128B">128B</option>
				<option value="128C">128C</option>
				<option value="128Auto">128Auto</option>
				<option value="EAN8">EAN8</option>
				<option value="EAN13">EAN13</option>
				<option value="EAN128A">EAN128A</option>
				<option value="EAN128B">EAN128B</option>
				<option value="EAN128C">EAN128C</option>
				<option value="Code39">Code39</option>
				<option value="39Extended">39Extended</option>
				<option value="Code93">Code93</option>					
			</select></td>
        </tr>
    	<tr>
        	<th>打印字符：</th>
            <td><input type="text" value="<?php echo $info['OUTERCODE']?>" class="input-text" id="text1" ></td>
        </tr>
		<tr>
        	<th>数量：</th>
            <td><input type="text" value="<?php echo $info['QUANTITY']?>" class="input-text" id="num1" ></td>
        </tr>
		<tr><td colspan="2"><input type="button" value="打印预览" name="B3"  onclick="prn_Preview()">&nbsp;&nbsp;<input type="button" value="打印设计" name="B3" onclick="prn_Design()"></td></tr>
    </tbody></table>
	</div>
    <div class="undis" id="sub2">
	<table cellpadding="0" cellspacing="0" class="table_form" width="100%">
		<tbody>
		
    	<tr>
        	<th>条码：</th>
            <td><input type="text" value="B10AA16000000" class="input-text" id="code2" ></td>
        </tr>
		<tr>
        	<th>物料名称：</th>
            <td><input type="text" value="轮轴" class="input-text" id="name2" ></td>
        </tr>
		<tr>
        	<th>图号：</th>
            <td><input type="text" value="16000" class="input-text" id="img2" ></td>
        </tr>
		<tr>
        	<th>单位：</th>
            <td><input type="text" value="pcs" class="input-text" id="unit2" ></td>
        </tr>
		<tr>
        	<th>数量：</th>
            <td><input type="text" value="3" class="input-text" id="num2" ></td>
        </tr>
		<tr>
        	<th>日期：</th>
            <td><input type="text" value="<?php echo date('Ymd',time())?>" class="input-text" id="date2" ></td>
        </tr>
		<tr>
        	<th>备注：</th>
            <td><input type="text" value="test" class="input-text" id="note2" ></td>
        </tr>
		<tr><td colspan="2"><input type="button" value="打印预览" name="B3"  onclick="prn_Preview1()">&nbsp;&nbsp;<input type="button" value="打印设计" name="B3" onclick="prn_Design1()"></td></tr>
    </tbody></table>
	</div>
	<div class="undis" id="sub3"><input type="button" value="生成条形码" name="B3" onclick="myShow1()" /></div>
    <div class="undis" id="sub4"><input type="button" value="生成条形码1" name="B3" onclick="myShow2()" /></div>
    </div>
</div>
<br>
<object id="LODOP1" classid="clsid:2105C259-1E0C-4534-8141-A753534CB4CA" width=800 height=400> 
  <param name="Caption" value="显示区">
  <param name="Border" value="0">
  <param name="Color" value="white"> 
  <embed id="LODOP_EM1" TYPE="application/x-print-lodop" width=800 height=400 border=0 Color="white" PLUGINSPAGE="install_lodop.exe">
</object> 
<script language="javascript" type="text/javascript">  
        var LODOP; //声明为全局变量  
	function prn_Preview() {		
		CreatePrintPage();
	  	LODOP.PREVIEW();		
	};
	function prn_Preview1() {		
		CreatePrintPage1();
	  	LODOP.PREVIEW();		
	};
	function prn_Design() {		
		CreatePrintPage();
		LODOP.PRINT_DESIGN();		
	};	
	function prn_Design1() {		
		CreatePrintPage1();
		LODOP.PRINT_DESIGN();		
	};	
	function CreatePrintPage() {
		LODOP=getLodop(document.getElementById('LODOP1'),document.getElementById('LODOP_EM1')); 
		LODOP.PRINT_INITA(0,0,1000,1600,"打印条码");
		var text = document.getElementById('text1');
		var code = document.getElementById('code1');
		var num = document.getElementById('num1').value;
		var i = 1;
		for(i=1;i<=num;i++){			
			LODOP.ADD_PRINT_BARCODE(-20+(i%2==0?(i-1)*(47+10):(47+10)*i),34+(i%2 ?  0 : (307+100)),307,47,code.value,text.value+i);
			LODOP.SET_PRINT_STYLEA(0,"FontSize",12);
		}	
	};	
	
	function CreatePrintPage1() {
		LODOP=getLodop(document.getElementById('LODOP1'),document.getElementById('LODOP_EM1')); 
		LODOP.PRINT_INITA(0,0,1000,1600,"打印条码");
		var text = document.getElementById('code2').value;
		var name = document.getElementById('name2').value;
		var note = document.getElementById('note2').value;
		var unit2 = document.getElementById('unit2').value;
		var date = document.getElementById('date2').value;
		var img = document.getElementById('img2').value;
		var num = document.getElementById('num2').value;
		var i = 1;
		for(i=1;i<=num;i++){
			LODOP.SET_PRINT_STYLE("Bold","1");
			LODOP.ADD_PRINT_TEXT(-40+(i%2==0?(i-1)*80:80*i),34+(i%2 ?  0 : (307+100)),307,47,'物料名称：'+name)	;
			LODOP.SET_PRINT_STYLEA(0,"FontSize",11);			
			LODOP.ADD_PRINT_TEXT(-23+(i%2==0?(i-1)*80:80*i),34+(i%2 ?  0 : (307+100)),307,47,'规格/图号：'+img);
			LODOP.SET_PRINT_STYLEA(0,"FontSize",11);
			LODOP.ADD_PRINT_TEXT(-6+(i%2==0?(i-1)*80:80*i),34+(i%2 ?  0 : (307+100)),450,47,'单位：'+unit2+'   数量：'+num+'   日期：'+date);
			LODOP.SET_PRINT_STYLEA(0,"FontSize",11);		
			LODOP.ADD_PRINT_BARCODE(13+(i%2==0?(i-1)*80:80*i),34+(i%2 ?  43 : 450),307,47,'128A',text);
			LODOP.SET_PRINT_STYLEA(0,"FontSize",11);
			LODOP.ADD_PRINT_TEXT(60+(i%2==0?(i-1)*80:80*i),34+(i%2 ?  0 : (307+100)),307,47,'备注：'+note);	
			LODOP.SET_PRINT_STYLEA(0,"FontSize",11);
		}	
	};
	
   	function myShow1() {
		LODOP=getLodop(document.getElementById('LODOP1'),document.getElementById('LODOP_EM1')); 	    	
		LODOP.PRINT_INIT("打印控件功能演示_Lodop功能_内嵌显示演示11");
		LODOP.ADD_PRINT_BARCODE(28,34,227,147,"128A","AB123456789012");
		LODOP.PREVIEW();
		//LODOP.SHOW_CHART();
  	}; 
   	function myShow2() {
		LODOP=getLodop(document.getElementById('LODOP1'),document.getElementById('LODOP_EM1')); 
		LODOP.PRINT_INITA(0,0,800,400,"打印控件功能演示_Lodop功能_内嵌显示演示11_2");
		LODOP.ADD_PRINT_BARCODE(28,34,109,338,"128A","1212AS3456789012");
		LODOP.SET_PRINT_STYLEA(0,"Angle",90);
		LODOP.ADD_PRINT_CHART(26,155,338,162,3,"空");
		LODOP.ADD_PRINT_RECT(46,538,131,107,0,1);
		LODOP.ADD_PRINT_SHAPE(5,260,559,100,60,0,1,"#FF00FF");
		LODOP.ADD_PRINT_IMAGE(232,200,282,92,"<img border='0' src='http://www.baidu.com/img/baidu_logo.gif'/>");
		LODOP.ADD_PRINT_LINE(206,558,207,658,0,1);
		LODOP.ADD_PRINT_LINE(160,605,242,606,0,1);
		var strProgram=LODOP.PRINT_DESIGN();
		eval(strProgram);
		LODOP.SHOW_CHART();
  	}; 
</script> 